From: David Härdeman Date: Wed, 24 Sep 2025 13:27:27 +0000 (+0200) Subject: dhcpv4: move struct dhcpv4_dnr to header X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22http:/www.crowdsec.net/%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22?a=commitdiff_plain;h=2649ee838c0510b9cf77aa2d3f0e9b4d34706c38;p=project%2Fodhcpd.git dhcpv4: move struct dhcpv4_dnr to header This helps declutter dhcpv4.c a little bit. Signed-off-by: David Härdeman Link: https://github.com/openwrt/odhcpd/pull/264 Signed-off-by: Álvaro Fernández Rojas --- diff --git a/src/dhcpv4.c b/src/dhcpv4.c index f7d93c4..cf5a244 100644 --- a/src/dhcpv4.c +++ b/src/dhcpv4.c @@ -318,14 +318,6 @@ static int dhcpv4_send_reply(const void *buf, size_t len, return sendto(*sock, buf, len, MSG_DONTWAIT, dest, dest_len); } -/* DNR */ -struct dhcpv4_dnr { - uint16_t len; - uint16_t priority; - uint8_t adn_len; - uint8_t body[]; -}; - void dhcpv4_handle_msg(void *addr, void *data, size_t len, struct interface *iface, _unused void *dest_addr, send_reply_cb_t send_reply, void *opaque) diff --git a/src/dhcpv4.h b/src/dhcpv4.h index f02529f..7db5c52 100644 --- a/src/dhcpv4.h +++ b/src/dhcpv4.h @@ -97,6 +97,14 @@ struct dhcpv4_option { uint8_t data[]; }; +/* DNR */ +struct dhcpv4_dnr { + uint16_t len; + uint16_t priority; + uint8_t adn_len; + uint8_t body[]; +}; + #define dhcpv4_for_each_option(start, end, opt)\ for (opt = (struct dhcpv4_option*)(start); \